from utils.readFileUtils.excel_control import write_excle_data

def file_data(filedir):
    with open(filedir,encoding='utf-8')as file:
        content = file.read()

    content = content.split('\n')
    data = []
    for i in content:
        data_dict = eval(i)
        # data.append(data_dict["OrderSourceSKU"])
        if data_dict['ASINorItemID'] != '':
            data.append(data_dict)

    write_excle_data(excle_data=data, filedir="D:\web_autotest\zhcx-service-test\Common\\")

    return data

if __name__ == '__main__':
    res = file_data("D:\web_autotest\zhcx-service-test\Common\TESTDATA-20230208110214.csv")
    print(res)







